"""
集合作用：数据去重
集合：可变set（）、不可变fronzenset（）
集合数据是无序的

迭代（iterable）：可遍历
不可迭代：数字
"""

str1 = "aaaaaaaaaaaaabbbbbbffffffffff"
# 去重
new_st1 = set(str1)
# {'a', 'b', 'f'}，注意与字典区分，字典内为键值对
print(new_st1)

print("----"*8)

data_01 = ("nginx","tomcat","php","redis","tomcat","php","tomcat","php")
new_data_01 = frozenset(data_01)
# frozenset({'nginx', 'php', 'tomcat', 'redis'})
print(new_data_01)

# 遍历
for i in new_data_01:
    print(i)

# 统计字符出现次数
for i in set(str1):
    print("字符：%s，出现次数：%s" %(i,str1.count(i)))
